#ifndef _CANARY2_UTIL_LOGGER_H_
#define _CANARY2_UTIL_LOGGER_H_

#include <log4cpp/Appender.hh>
#include <log4cpp/Category.hh>
#include <log4cpp/Layout.hh>
#include <log4cpp/Priority.hh>
#include <log4cpp/OstreamAppender.hh>
#include <log4cpp/PatternLayout.hh>

#include <fmt/format.h>
#include <string_view>

namespace wilson::util
{
    void log_init(::log4cpp::Priority::PriorityLevel p = ::log4cpp::Priority::DEBUG);
    void log_init(::std::string_view val);
}

#define WILSON_LOG_DEBUG(msg) \
    ::log4cpp::Category::getRoot().debug(\
        fmt::format("func: {}, posi: {}:{}, message: {}", \
            __func__, __FILE__, __LINE__, (msg)));

#endif
